classDiagram
    class FlyweightFactory {
        -flyweights: Map~string, Flyweight~
        +getFlyweight(sharedState: string): Flyweight
        +listFlyweights(): void
    }
    
    class Flyweight {
        <<interface>>
        +operation(uniqueState: string): void
    }

    class ConcreteFlyweight {
        -sharedState: string
        +operation(uniqueState: string): void
    }

    class UnsharedConcreteFlyweight {
        -allState: string
        +operation(uniqueState: string): void
    }

    FlyweightFactory --> Flyweight : manages >
    Flyweight <|-- ConcreteFlyweight : implements
    Flyweight <|-- UnsharedConcreteFlyweight : implements
